home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 009a / snpd0493.zip / NOCTRLC.C < prev    next >
C/C++ Source or Header  |  1993-04-05  |  1KB  |  45 lines

  1. .I 6 30
  2. #include <dos.h>
  3.  
  4. #if defined(__ZTC__)
  5.  #define INTERRUPT
  6.  #define FAR            _far
  7.  #define ENABLE         int_on
  8.  #define INPORTB        inp
  9.  #define OUTPORTB       outp
  10. #else
  11.  #include <conio.h>
  12.  #if defined(__TURBOC__)
  13.   #define INTERRUPT      interrupt
  14.   #define FAR            far
  15.   #define ENABLE         enable
  16.   #define INPORTB        inportb
  17.   #define OUTPORTB       outportb
  18.  #else
  19.   #define INTERRUPT      _interrupt
  20.   #define FAR            _far
  21.   #define ENABLE         _enable
  22.   #define INPORTB        inp
  23.   #define OUTPORTB       outp
  24.  #endif
  25. #endif
  26.  
  27. extern void (INTERRUPT FAR *oldint9)(void);     /* Caller must set this */
  28.  
  29. void INTERRUPT FAR noctrl(void)
  30. {
  31.       unsigned char byte;
  32. .D 7 3
  33. .I 10 4
  34.  
  35.       ENABLE();
  36.  
  37.       if ((byte = (unsigned char)INPORTB(0x60)) == 29)
  38. .D 11 5
  39. .I 28 4
  40.             byte = (unsigned char)INPORTB(0x61);
  41.             OUTPORTB(0x61,byte | 0x80);
  42.             OUTPORTB(0x61,byte);
  43.             OUTPORTB(0x20,0x20);
  44. .D 29 4
  45.